package oj;

import java.util.Arrays;
import java.util.Scanner;

public class Day1F {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        long sum=0;//int会溢出
        while (scanner.hasNext()){
            int n=scanner.nextInt();
            scanner.nextLine();
            int[] arr=new int[3*n];
            for (int i = 0; i < 3*n; i++) {
                arr[i]=scanner.nextInt();
            }
            Arrays.sort(arr);
            int j=n;
            while (j< 3*n){
                sum+=arr[j];
                j+=2;
            }
        }
        System.out.println(sum);
    }
}
